Repository navigation
fix(review): failures are never clean: engine errors reported, per-file isolation, PII abstention, gate dismissal - #1723
RaghwendraSingh wants to merge 4 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
There was a problem hiding this comment.
4 issues found across 10 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/opencode/src/altimate/review/format.ts">
<violation number="1" location="packages/opencode/src/altimate/review/format.ts:210">
P3: Grouping by the full reason text fragments per-file error messages into one note each, so a widespread failure produces many notes. Group by a normalized reason category, or cap the number of distinct notes, so the comment stays compact.</violation>
<violation number="2" location="packages/opencode/src/altimate/review/format.ts:220">
P3: `e.reason` is not sanitized here, and PR-level lane errors can contain newlines. That breaks the `> ℹ️` blockquote in the posted comment. Collapse whitespace before interpolating the reason.</violation>
</file>
<file name="packages/opencode/src/altimate/review/post-github.ts">
<violation number="1" location="packages/opencode/src/altimate/review/post-github.ts:146">
P2: A failed dismissal must not fall through to the no-new-review skip path. Track failed IDs and only skip after every stale blocking review is dismissed; otherwise surface the incomplete cleanup and retry or leave an explicit failure signal instead of claiming no review was needed.</violation>
</file>
<file name="docs/docs/usage/dbt-pr-review.md">
<violation number="1" location="docs/docs/usage/dbt-pr-review.md:317">
P2: The docs overstate the engine-error downgrade: a gate-mode run with an engine error and another blocking finding can still return `REQUEST_CHANGES`. Limit this statement to otherwise empty reviews, which are downgraded from APPROVE to COMMENT.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
| columns the base already surfaced. A model the PII check could not analyse is | ||
| listed as not fully verified. | ||
| - **Failures are never a clean pass:** if an engine check throws, the comment | ||
| names it and the verdict is at most COMMENT, never APPROVE (envelope |
There was a problem hiding this comment.
P2: The docs overstate the engine-error downgrade: a gate-mode run with an engine error and another blocking finding can still return REQUEST_CHANGES. Limit this statement to otherwise empty reviews, which are downgraded from APPROVE to COMMENT.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At docs/docs/usage/dbt-pr-review.md, line 317:
<comment>The docs overstate the engine-error downgrade: a gate-mode run with an engine error and another blocking finding can still return `REQUEST_CHANGES`. Limit this statement to otherwise empty reviews, which are downgraded from APPROVE to COMMENT.</comment>
<file context>
@@ -311,7 +311,14 @@ rubric:
+ columns the base already surfaced. A model the PII check could not analyse is
+ listed as not fully verified.
+- **Failures are never a clean pass:** if an engine check throws, the comment
+ names it and the verdict is at most COMMENT, never APPROVE (envelope
+ `engineErrors`). A failure on one file marks that file unverified and the rest
+ of the PR is still reviewed.
</file context>
| names it and the verdict is at most COMMENT, never APPROVE (envelope | |
| names it; an otherwise empty review is COMMENT rather than APPROVE (envelope |
There was a problem hiding this comment.
Follow-up: low priority, tracked. The docs will say "an otherwise clean review is COMMENT, not APPROVE".
| "Run `dbt compile` (and compile the base into `target-base/`) for equivalence and lineage checks.", | ||
| ) | ||
| const byReason = new Map<string, string[]>() | ||
| for (const u of unverified) byReason.set(u.reason, [...(byReason.get(u.reason) ?? []), u.path]) |
There was a problem hiding this comment.
P3: Grouping by the full reason text fragments per-file error messages into one note each, so a widespread failure produces many notes. Group by a normalized reason category, or cap the number of distinct notes, so the comment stays compact.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At packages/opencode/src/altimate/review/format.ts, line 210:
<comment>Grouping by the full reason text fragments per-file error messages into one note each, so a widespread failure produces many notes. Group by a normalized reason category, or cap the number of distinct notes, so the comment stays compact.</comment>
<file context>
@@ -206,13 +206,19 @@ export function coverageNotes(env: VerdictEnvelope): string[] {
- "Run `dbt compile` (and compile the base into `target-base/`) for equivalence and lineage checks.",
- )
+ const byReason = new Map<string, string[]>()
+ for (const u of unverified) byReason.set(u.reason, [...(byReason.get(u.reason) ?? []), u.path])
+ for (const [reason, paths] of byReason) {
+ const head = paths.slice(0, 5).map((p) => `\`${p}\``).join(", ")
</file context>
There was a problem hiding this comment.
Follow-up: low priority, tracked. We will group per-file failures by reason prefix.
| notes.push(`${paths.length} model(s) not fully verified — ${reason}: ${head}${more}.${hint}`) | ||
| } | ||
| if (env.engineErrors?.length) { | ||
| const list = env.engineErrors.map((e) => `${e.method} ×${e.count} (${e.reason})`).join("; ") |
There was a problem hiding this comment.
P3: e.reason is not sanitized here, and PR-level lane errors can contain newlines. That breaks the > ℹ️ blockquote in the posted comment. Collapse whitespace before interpolating the reason.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At packages/opencode/src/altimate/review/format.ts, line 220:
<comment>`e.reason` is not sanitized here, and PR-level lane errors can contain newlines. That breaks the `> ℹ️` blockquote in the posted comment. Collapse whitespace before interpolating the reason.</comment>
<file context>
@@ -206,13 +206,19 @@ export function coverageNotes(env: VerdictEnvelope): string[] {
+ notes.push(`${paths.length} model(s) not fully verified — ${reason}: ${head}${more}.${hint}`)
+ }
+ if (env.engineErrors?.length) {
+ const list = env.engineErrors.map((e) => `${e.method} ×${e.count} (${e.reason})`).join("; ")
+ notes.push(`Some engine checks failed and did not run: ${list}. This verdict is not a clean approval.`)
}
</file context>
There was a problem hiding this comment.
Follow-up: low priority, tracked. prLevel will collapse whitespace the way fail() does.
| const piiRes = engineNewSql ? await input.runner.detectPii(engineNewSql, dialect) : { columns: [] } | ||
| if (piiRes.abstained) unverified.push({ path: file.path, reason: "the PII check could not analyse this model" }) | ||
| const pii = piiRes.columns | ||
| const complex = engineNewSql && input.runner.isComplex ? await input.runner.isComplex(engineNewSql) : false |
There was a problem hiding this comment.
WARNING: The per-file try is too coarse — a failure in a supplementary call discards the whole file.
ctxByPath.set is the last statement of the block (line 1190), so a throw from input.runner.impact(...) (1184), detectPii(...) (1186) or isComplex(...) (1189) leaves the file out of ctxByPath entirely. isComplex in particular is only a tiering hint, yet its failure means the file gets no quality / semantic-change / dbt-patterns lanes, no lineage lane, and no blast-radius / PII / complexity signal for tiering (blastRadiusOf / touchesPiiOf / isComplexOf at 1227-1231) — zero review even though its SQL was read successfully.
Consider per-call fallbacks (impact → zeroed result, pii: [], complex: false) and always calling ctxByPath.set once the content has been fetched, so an enrichment failure degrades the file instead of skipping it.
There was a problem hiding this comment.
Follow-up: low priority, tracked. Giving impact, detectPii and isComplex separate fallbacks is reasonable. Today a throw there still lands the file in unverified, and with this commit that also blocks APPROVE.
| const impact = await input.runner.impact(model) | ||
| if (impact.hasManifest) anyManifest = true | ||
| const piiRes = engineNewSql ? await input.runner.detectPii(engineNewSql, dialect) : { columns: [] } | ||
| if (piiRes.abstained) unverified.push({ path: file.path, reason: "the PII check could not analyse this model" }) |
There was a problem hiding this comment.
SUGGESTION: An abstained PII result is reported but then treated as "no PII" for tiering. pii is assigned piiRes.columns, which is empty, so touchesPiiOf (line 1230) returns false and the FULL-tier "PII column touched" hard floor cannot fire. On trivial/lite tiers pii_exposure is not in TIER_LANES, so piiLane never runs for this file either, leaving only the coarse regex twins. Abstention means unknown, not clean — consider promoting the file (or keeping the broad fallback) when abstained is true.
There was a problem hiding this comment.
Follow-up: low priority, tracked. Treating a PII abstention as "touches PII" for tiering is a fair suggestion.
| scope: ReviewScope.optional(), | ||
| /** Engine calls that failed during the review. Their checks did not run, so | ||
| * the verdict is never a clean APPROVE when this is present. */ | ||
| engineErrors: z |
There was a problem hiding this comment.
SUGGESTION: An empty engineErrors array satisfies this schema, and buildEnvelope (line 256) tests input.engineErrors?.length, so engineErrors: [] still produces APPROVE — contradicting the field doc above ("the verdict is never a clean APPROVE when this is present"). runReview normalises empty to undefined, but buildEnvelope is exported and called directly (including from tests). Add .min(1) or normalise empty to undefined in buildEnvelope.
There was a problem hiding this comment.
Not changing: buildEnvelope tests engineErrors?.length and runReview normalises an empty list to undefined, so an empty array never changes the verdict.
Code Review SummaryStatus: 4 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (14 files)
Fix these issues in Kilo Cloud Previous Review Summary (commit 7e2a8c7)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 7e2a8c7)Status: 3 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (10 files)
Reviewed by deepseek-v4.1-flash-1017 · Input: 162.5K · Output: 32K · Cached: 3.6M Review guidance: REVIEW.md from base branch |
7e2a8c7 to
6736c7c
Compare
8ce9cec to
4004ec6
Compare
There was a problem hiding this comment.
2 issues found across 5 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/opencode/src/altimate/review/git.ts">
<violation number="1" location="packages/opencode/src/altimate/review/git.ts:212">
P2: The deepen fetch adds `headSha` as a raw SHA request, which requires the remote to allow reachable SHA wants and can make otherwise-valid CI remotes reject the fetch. Remove this extra argument; the target-branch refspec is sufficient for deepening the shallow checkout.</violation>
<violation number="2" location="packages/opencode/src/altimate/review/git.ts:267">
P3: The result of `find()` inside `fetchTargetHistory` is thrown away and `find()` runs again here. Have `fetchTargetHistory` return the resolved base (or undefined) so the caller uses it directly, which also removes the boolean-plus-callback pattern.</violation>
</file>
Tip: Get a Slack DM when cubic finishes reviewing your PRs. Connect Slack
View guided diff | Turn on auto-fix | Re-trigger cubic
| try { | ||
| if ((await git(["rev-parse", "--is-shallow-repository"], cwd)).trim() !== "true") return false | ||
| const headSha = (await git(["rev-parse", "HEAD"], cwd)).trim() | ||
| await git(["fetch", "--no-tags", `--deepen=${depth}`, "origin", `+refs/heads/${branch}:refs/remotes/origin/${branch}`, headSha], cwd) |
There was a problem hiding this comment.
P2: The deepen fetch adds headSha as a raw SHA request, which requires the remote to allow reachable SHA wants and can make otherwise-valid CI remotes reject the fetch. Remove this extra argument; the target-branch refspec is sufficient for deepening the shallow checkout.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At packages/opencode/src/altimate/review/git.ts, line 212:
<comment>The deepen fetch adds `headSha` as a raw SHA request, which requires the remote to allow reachable SHA wants and can make otherwise-valid CI remotes reject the fetch. Remove this extra argument; the target-branch refspec is sufficient for deepening the shallow checkout.</comment>
<file context>
@@ -191,6 +191,33 @@ async function mergeBase(a: string, b: string, cwd: string): Promise<string | un
+ try {
+ if ((await git(["rev-parse", "--is-shallow-repository"], cwd)).trim() !== "true") return false
+ const headSha = (await git(["rev-parse", "HEAD"], cwd)).trim()
+ await git(["fetch", "--no-tags", `--deepen=${depth}`, "origin", `+refs/heads/${branch}:refs/remotes/origin/${branch}`, headSha], cwd)
+ } catch {
+ return false
</file context>
| await git(["fetch", "--no-tags", `--deepen=${depth}`, "origin", `+refs/heads/${branch}:refs/remotes/origin/${branch}`, headSha], cwd) | |
| await git(["fetch", "--no-tags", `--deepen=${depth}`, "origin", `+refs/heads/${branch}:refs/remotes/origin/${branch}`], cwd) |
There was a problem hiding this comment.
Follow-up: low priority, tracked. GitHub accepts the raw-SHA want, and on other remotes a failed fetch only means the base isn't found. A retry without the SHA is a cheap addition.
| } | ||
| return undefined | ||
| } | ||
| const found = (await find()) ?? ((await fetchTargetHistory(target.branch, opts.cwd, find)) ? await find() : undefined) |
There was a problem hiding this comment.
P3: The result of find() inside fetchTargetHistory is thrown away and find() runs again here. Have fetchTargetHistory return the resolved base (or undefined) so the caller uses it directly, which also removes the boolean-plus-callback pattern.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At packages/opencode/src/altimate/review/git.ts, line 267:
<comment>The result of `find()` inside `fetchTargetHistory` is thrown away and `find()` runs again here. Have `fetchTargetHistory` return the resolved base (or undefined) so the caller uses it directly, which also removes the boolean-plus-callback pattern.</comment>
<file context>
@@ -230,10 +257,15 @@ export async function resolveReviewBase(opts: ResolveBaseOptions): Promise<Resol
+ }
+ return undefined
}
+ const found = (await find()) ?? ((await fetchTargetHistory(target.branch, opts.cwd, find)) ? await find() : undefined)
+ if (found) return found
throw new Error(
</file context>
There was a problem hiding this comment.
Not changing for now: the cost is one extra git merge-base after a deepen fetch. Duplicate of the dev-punia D2/D3 comments.
dev-punia-altimate
left a comment
There was a problem hiding this comment.
🤖 Code Review — OpenCodeReview (Gemini) — 6 finding(s)
- 6 anchored to a line (posted inline when the comment stream is on)
- 0 without a line anchor
All findings (full text)
1. packages/opencode/src/altimate/review/format.ts (L209-L210)
[🟠 MEDIUM] Using the array spread operator within a loop to accumulate items creates a new array on each iteration. This can lead to O(N²) time complexity and unnecessary memory allocations when there are many items. It is more efficient to mutate the existing array by pushing new elements.
Suggested change:
const byReason = new Map<string, string[]>()
for (const u of unverified) {
const paths = byReason.get(u.reason)
if (paths) paths.push(u.path)
else byReason.set(u.reason, [u.path])
}
2. packages/opencode/src/altimate/review/git.ts (L194-L219)
[🟠 MEDIUM] By making fetchTargetHistory return a boolean, the caller is forced to execute await find() an extra time when the fetch succeeds. Since find() invokes an external git merge-base process, this results in redundant and potentially expensive operations. It is recommended to use a generic type so the function can return the found result directly, avoiding double evaluation.
Suggested change:
/**
* A default CI checkout is shallow (`actions/checkout` fetches one commit) and
* lacks the target branch. Fetch the branch, then deepen the history until a
* merge-base exists, so the review works without `fetch-depth: 0`. Returns
* the resolved value once `found` succeeds; undefined when it never does (no remote, no access).
*/
async function fetchTargetHistory<T>(branch: string, cwd: string, found: () => Promise<T | undefined>): Promise<T | undefined> {
if (branch.startsWith("-")) return undefined
try {
await git(["fetch", "--no-tags", "origin", `+refs/heads/${branch}:refs/remotes/origin/${branch}`], cwd)
} catch {
return undefined
}
let result = await found()
if (result) return result
for (const depth of [50, 200, 1000]) {
try {
if ((await git(["rev-parse", "--is-shallow-repository"], cwd)).trim() !== "true") return undefined
const headSha = (await git(["rev-parse", "HEAD"], cwd)).trim()
await git(["fetch", "--no-tags", `--deepen=${depth}`, "origin", `+refs/heads/${branch}:refs/remotes/origin/${branch}`, headSha], cwd)
} catch {
return undefined
}
result = await found()
if (result) return result
}
return undefined
}
3. packages/opencode/src/altimate/review/git.ts (L267-L268)
[🔵 LOW] Following the suggested refactoring of fetchTargetHistory, you can significantly simplify this caller logic. This effectively removes the complex ternary expression and avoids the redundant invocation of find().
Suggested change:
const found = (await find()) ?? (await fetchTargetHistory(target.branch, opts.cwd, find))
if (found) return found
4. packages/opencode/src/altimate/review/runner.ts (L269)
[🔵 LOW] Using any bypasses TypeScript's type checking and goes against best practices. Since data is already typed as Record<string, any>, data.pii is implicitly any, so the explicit as any cast is redundant. However, it's better to provide a more specific type structure, such as !!(data.pii as { parse_error?: boolean })?.parse_error, or properly type the pii property in the data interface to ensure type safety.
Suggested change:
piiAbstained: !!(data.pii as { parse_error?: boolean })?.parse_error,
5. packages/opencode/src/altimate/review/orchestrate.ts (L1433-L1436)
[🔴 HIGH] High Severity: Risk of synchronous exceptions bypassing .catch()
The fault-tolerance logic heavily relies on chaining .catch() directly to the promise returned by input.runner.check(...). However, check is an interface method. If the underlying implementation is not a strict async function and throws a synchronous exception (e.g., during argument validation before returning a Promise), the exception will bypass the .catch() and crash the Promise.all block.
To safely handle both synchronous exceptions and asynchronous rejections, it's recommended to wrap the await within a try/catch block.
Suggested change:
let cr: CheckResult = { ran: false }
try {
cr = await input.runner.check(ctx.engineNewSql, dialect, ctx.engineOldSql)
} catch {
// ignore failures
}
if (cr.ran) coreRanFiles.add(ctx.file.path)
6. packages/opencode/src/altimate/review/orchestrate.ts (L1156-L1166)
[🔵 LOW] Low Severity: Error object stringification obscuring details & Duplication of unverified files
- Object Stringification: Using
String(err)on plain object errors (e.g.,{ code: 500, message: "failed" }) will evaluate to"[object Object]", making debugging difficult. We should serialize plain objects usingJSON.stringify(). - Duplication in
unverified: A single file might be pushed tounverifiedmultiple times (e.g., once for PII abstained, and again here if a lane crashes). The downstream consumer or UI may not expect duplicate paths. It's recommended to deduplicate or aggregate reasons for the same path.
You can create a helper to format errors and ensure duplicate entries for the same file path are merged or ignored.
Suggested change:
const formatErr = (err: unknown) => err instanceof Error ? err.message : (typeof err === "object" && err !== null ? JSON.stringify(err) : String(err))
const laneErrors: Array<{ method: string; reason: string; count: number }> = []
// Consider taking a function `() => Promise<Finding[]>` and using try/catch if lanes can throw synchronously
const prLevel = (method: string, lane: Promise<Finding[]>) =>
lane.catch((err) => {
laneErrors.push({ method, reason: formatErr(err).slice(0, 200), count: 1 })
return [] as Finding[]
})
const failedFile = (file: { path: string }, err: unknown) => {
const reason = `review failed for this file: ${formatErr(err).replace(/\s+/g, " ").slice(0, 160)}`
const existing = unverified.find((u) => u.path === file.path)
if (existing) {
if (!existing.reason.includes(reason)) existing.reason += `; ${reason}`
} else {
unverified.push({ path: file.path, reason })
}
}
| const byReason = new Map<string, string[]>() | ||
| for (const u of unverified) byReason.set(u.reason, [...(byReason.get(u.reason) ?? []), u.path]) |
There was a problem hiding this comment.
[🟠 MEDIUM] Using the array spread operator within a loop to accumulate items creates a new array on each iteration. This can lead to O(N²) time complexity and unnecessary memory allocations when there are many items. It is more efficient to mutate the existing array by pushing new elements.
Suggested change:
| const byReason = new Map<string, string[]>() | |
| for (const u of unverified) byReason.set(u.reason, [...(byReason.get(u.reason) ?? []), u.path]) | |
| const byReason = new Map<string, string[]>() | |
| for (const u of unverified) { | |
| const paths = byReason.get(u.reason) | |
| if (paths) paths.push(u.path) | |
| else byReason.set(u.reason, [u.path]) | |
| } |
There was a problem hiding this comment.
Thanks, taken in 6fb2411. Paths are now pushed into the existing array. The list is small in practice (a handful of unverified files), but the change costs nothing.
| /** | ||
| * A default CI checkout is shallow (`actions/checkout` fetches one commit) and | ||
| * lacks the target branch. Fetch the branch, then deepen the history until a | ||
| * merge-base exists, so the review works without `fetch-depth: 0`. Returns | ||
| * true once `found` resolves; false when it never does (no remote, no access). | ||
| */ | ||
| async function fetchTargetHistory(branch: string, cwd: string, found: () => Promise<unknown>): Promise<boolean> { | ||
| if (branch.startsWith("-")) return false | ||
| try { | ||
| await git(["fetch", "--no-tags", "origin", `+refs/heads/${branch}:refs/remotes/origin/${branch}`], cwd) | ||
| } catch { | ||
| return false | ||
| } | ||
| if (await found()) return true | ||
| for (const depth of [50, 200, 1000]) { | ||
| try { | ||
| if ((await git(["rev-parse", "--is-shallow-repository"], cwd)).trim() !== "true") return false | ||
| const headSha = (await git(["rev-parse", "HEAD"], cwd)).trim() | ||
| await git(["fetch", "--no-tags", `--deepen=${depth}`, "origin", `+refs/heads/${branch}:refs/remotes/origin/${branch}`, headSha], cwd) | ||
| } catch { | ||
| return false | ||
| } | ||
| if (await found()) return true | ||
| } | ||
| return false | ||
| } |
There was a problem hiding this comment.
[🟠 MEDIUM] By making fetchTargetHistory return a boolean, the caller is forced to execute await find() an extra time when the fetch succeeds. Since find() invokes an external git merge-base process, this results in redundant and potentially expensive operations. It is recommended to use a generic type so the function can return the found result directly, avoiding double evaluation.
Suggested change:
| /** | |
| * A default CI checkout is shallow (`actions/checkout` fetches one commit) and | |
| * lacks the target branch. Fetch the branch, then deepen the history until a | |
| * merge-base exists, so the review works without `fetch-depth: 0`. Returns | |
| * true once `found` resolves; false when it never does (no remote, no access). | |
| */ | |
| async function fetchTargetHistory(branch: string, cwd: string, found: () => Promise<unknown>): Promise<boolean> { | |
| if (branch.startsWith("-")) return false | |
| try { | |
| await git(["fetch", "--no-tags", "origin", `+refs/heads/${branch}:refs/remotes/origin/${branch}`], cwd) | |
| } catch { | |
| return false | |
| } | |
| if (await found()) return true | |
| for (const depth of [50, 200, 1000]) { | |
| try { | |
| if ((await git(["rev-parse", "--is-shallow-repository"], cwd)).trim() !== "true") return false | |
| const headSha = (await git(["rev-parse", "HEAD"], cwd)).trim() | |
| await git(["fetch", "--no-tags", `--deepen=${depth}`, "origin", `+refs/heads/${branch}:refs/remotes/origin/${branch}`, headSha], cwd) | |
| } catch { | |
| return false | |
| } | |
| if (await found()) return true | |
| } | |
| return false | |
| } | |
| /** | |
| * A default CI checkout is shallow (`actions/checkout` fetches one commit) and | |
| * lacks the target branch. Fetch the branch, then deepen the history until a | |
| * merge-base exists, so the review works without `fetch-depth: 0`. Returns | |
| * the resolved value once `found` succeeds; undefined when it never does (no remote, no access). | |
| */ | |
| async function fetchTargetHistory<T>(branch: string, cwd: string, found: () => Promise<T | undefined>): Promise<T | undefined> { | |
| if (branch.startsWith("-")) return undefined | |
| try { | |
| await git(["fetch", "--no-tags", "origin", `+refs/heads/${branch}:refs/remotes/origin/${branch}`], cwd) | |
| } catch { | |
| return undefined | |
| } | |
| let result = await found() | |
| if (result) return result | |
| for (const depth of [50, 200, 1000]) { | |
| try { | |
| if ((await git(["rev-parse", "--is-shallow-repository"], cwd)).trim() !== "true") return undefined | |
| const headSha = (await git(["rev-parse", "HEAD"], cwd)).trim() | |
| await git(["fetch", "--no-tags", `--deepen=${depth}`, "origin", `+refs/heads/${branch}:refs/remotes/origin/${branch}`, headSha], cwd) | |
| } catch { | |
| return undefined | |
| } | |
| result = await found() | |
| if (result) return result | |
| } | |
| return undefined | |
| } |
There was a problem hiding this comment.
Thanks. This is correct, but the cost is one extra git merge-base, and only after a deepen fetch, so we're leaving it as is for this PR. It is noted as a cleanup for when fetchTargetHistory is next touched.
| const found = (await find()) ?? ((await fetchTargetHistory(target.branch, opts.cwd, find)) ? await find() : undefined) | ||
| if (found) return found |
There was a problem hiding this comment.
[🔵 LOW] Following the suggested refactoring of fetchTargetHistory, you can significantly simplify this caller logic. This effectively removes the complex ternary expression and avoids the redundant invocation of find().
Suggested change:
| const found = (await find()) ?? ((await fetchTargetHistory(target.branch, opts.cwd, find)) ? await find() : undefined) | |
| if (found) return found | |
| const found = (await find()) ?? (await fetchTargetHistory(target.branch, opts.cwd, find)) | |
| if (found) return found |
There was a problem hiding this comment.
Thanks. Same as D2: a readability cleanup with no behaviour change, deferred together with it.
| issues, | ||
| piiColumns: [...new Set(piiColumns)], | ||
| ran: true, | ||
| piiAbstained: !!(data.pii as any)?.parse_error, |
There was a problem hiding this comment.
[🔵 LOW] Using any bypasses TypeScript's type checking and goes against best practices. Since data is already typed as Record<string, any>, data.pii is implicitly any, so the explicit as any cast is redundant. However, it's better to provide a more specific type structure, such as !!(data.pii as { parse_error?: boolean })?.parse_error, or properly type the pii property in the data interface to ensure type safety.
Suggested change:
| piiAbstained: !!(data.pii as any)?.parse_error, | |
| piiAbstained: !!(data.pii as { parse_error?: boolean })?.parse_error, |
There was a problem hiding this comment.
Thanks. The any here reads loosely typed engine JSON whose shape changes across core versions; every field read is guarded (asArray, typeof checks). Typing the engine payloads properly is a broader change than this PR.
| const cr = await input.runner | ||
| .check(ctx.engineNewSql, dialect, ctx.engineOldSql) | ||
| .catch(() => ({ ran: false }) as CheckResult) | ||
| if (cr.ran) coreRanFiles.add(ctx.file.path) |
There was a problem hiding this comment.
[🔴 HIGH] High Severity: Risk of synchronous exceptions bypassing .catch()
The fault-tolerance logic heavily relies on chaining .catch() directly to the promise returned by input.runner.check(...). However, check is an interface method. If the underlying implementation is not a strict async function and throws a synchronous exception (e.g., during argument validation before returning a Promise), the exception will bypass the .catch() and crash the Promise.all block.
To safely handle both synchronous exceptions and asynchronous rejections, it's recommended to wrap the await within a try/catch block.
Suggested change:
| const cr = await input.runner | |
| .check(ctx.engineNewSql, dialect, ctx.engineOldSql) | |
| .catch(() => ({ ran: false }) as CheckResult) | |
| if (cr.ran) coreRanFiles.add(ctx.file.path) | |
| let cr: CheckResult = { ran: false } | |
| try { | |
| cr = await input.runner.check(ctx.engineNewSql, dialect, ctx.engineOldSql) | |
| } catch { | |
| // ignore failures | |
| } | |
| if (cr.ran) coreRanFiles.add(ctx.file.path) |
There was a problem hiding this comment.
Thanks for flagging this. In this case it can't happen. ReviewRunner.check returns runCheck(...), which is an async function (runner.ts check(sql, dialect, baseSql) { return runCheck(sql, dialect, baseSql) }), so any throw inside it becomes a rejected promise and .catch() handles it. The test runners in the suite are async as well. Separately, 6fb2411 moves the remaining synchronous detectors into the per-file task list.
| const laneErrors: Array<{ method: string; reason: string; count: number }> = [] | ||
| const prLevel = (method: string, lane: Promise<Finding[]>) => | ||
| lane.catch((err) => { | ||
| laneErrors.push({ method, reason: (err instanceof Error ? err.message : String(err)).slice(0, 200), count: 1 }) | ||
| return [] as Finding[] | ||
| }) | ||
| const failedFile = (file: { path: string }, err: unknown) => | ||
| unverified.push({ | ||
| path: file.path, | ||
| reason: `review failed for this file: ${(err instanceof Error ? err.message : String(err)).replace(/\s+/g, " ").slice(0, 160)}`, | ||
| }) |
There was a problem hiding this comment.
[🔵 LOW] Low Severity: Error object stringification obscuring details & Duplication of unverified files
- Object Stringification: Using
String(err)on plain object errors (e.g.,{ code: 500, message: "failed" }) will evaluate to"[object Object]", making debugging difficult. We should serialize plain objects usingJSON.stringify(). - Duplication in
unverified: A single file might be pushed tounverifiedmultiple times (e.g., once for PII abstained, and again here if a lane crashes). The downstream consumer or UI may not expect duplicate paths. It's recommended to deduplicate or aggregate reasons for the same path.
You can create a helper to format errors and ensure duplicate entries for the same file path are merged or ignored.
Suggested change:
| const laneErrors: Array<{ method: string; reason: string; count: number }> = [] | |
| const prLevel = (method: string, lane: Promise<Finding[]>) => | |
| lane.catch((err) => { | |
| laneErrors.push({ method, reason: (err instanceof Error ? err.message : String(err)).slice(0, 200), count: 1 }) | |
| return [] as Finding[] | |
| }) | |
| const failedFile = (file: { path: string }, err: unknown) => | |
| unverified.push({ | |
| path: file.path, | |
| reason: `review failed for this file: ${(err instanceof Error ? err.message : String(err)).replace(/\s+/g, " ").slice(0, 160)}`, | |
| }) | |
| const formatErr = (err: unknown) => err instanceof Error ? err.message : (typeof err === "object" && err !== null ? JSON.stringify(err) : String(err)) | |
| const laneErrors: Array<{ method: string; reason: string; count: number }> = [] | |
| // Consider taking a function `() => Promise<Finding[]>` and using try/catch if lanes can throw synchronously | |
| const prLevel = (method: string, lane: Promise<Finding[]>) => | |
| lane.catch((err) => { | |
| laneErrors.push({ method, reason: formatErr(err).slice(0, 200), count: 1 }) | |
| return [] as Finding[] | |
| }) | |
| const failedFile = (file: { path: string }, err: unknown) => { | |
| const reason = `review failed for this file: ${formatErr(err).replace(/\s+/g, " ").slice(0, 160)}` | |
| const existing = unverified.find((u) => u.path === file.path) | |
| if (existing) { | |
| if (!existing.reason.includes(reason)) existing.reason += `; ${reason}` | |
| } else { | |
| unverified.push({ path: file.path, reason }) | |
| } | |
| } |
There was a problem hiding this comment.
Thanks. Errors on this path are Error instances in practice (we read .message), and String(err) is only a fallback. Duplicate paths are harmless because the notes group by reason. We'll keep it as is.
|
Kilo Code Review could not run — your account is out of credits. Add credits or switch to a free model to enable reviews on this change. |
🤖 Code Review — OpenCodeReview (Gemini) — No Issues FoundNo supported files changed. |
hkaltai
left a comment
There was a problem hiding this comment.
Verdict: changes requested. Panel: Claude, Codex and a lead review (independent). Scope: this PR's diff against its stacked base only.
The design is sound (per-method failure recording, signed engineErrors, per-file isolation, injectable client). But the title's invariant only holds for thrown engine errors: core's in-band success:false, per-file failures and PII abstentions can still produce APPROVE, and PII abstention can still clear an earlier block.
Counts: CRITICAL 0, MAJOR 3, MINOR 3, NIT 5.
Missing tests: native success:false responses and a real createDispatcherRunner failure path; verdict assertions for file failure and PII abstention; a block surviving PII abstention; human review quoting the headline; deepening beyond 50 commits.
Nits
post-github.ts:66— orphaned doc comment/** Headline of a review this bot posted (see verdictHeadline). */now sits aboverunCompleted; move it back aboveBOT_REVIEW_RE.runner.ts:367—fail("dbtConfigLint", err)in thedbt_config_diffbranch names the wrong call; use"dbtConfigDiff".runner.ts:360,368—/* skip */after the newfail(...)calls is now misleading; remove.orchestrate.ts:1158—laneErrorsreasons ((err instanceof Error ? err.message : String(err)).slice(0, 200)) don't collapse whitespace likefail()/failedFile; a multi-line message breaks the markdown note. Use one shared helper.- Naming: runner
failures()vs envelopeengineErrorsvslaneErrors; considerengineErrors().runCompletedrelies on matching reason text; a typedkindon unverified entries would fit the name.
| piiColumns: [...new Set(piiColumns)], | ||
| ran: true, | ||
| piiAbstained: !!(data.pii as any)?.parse_error, | ||
| } |
There was a problem hiding this comment.
[MAJOR] Core's in-band success:false reads as a clean run
ran: true,
piiAbstained: !!(data.pii as any)?.parse_error,(const data = (res.data ?? {}) at runner.ts:211 never checks res.success.)
Native handlers catch their own exceptions and return { success: false, data: {}, error } (native/altimate-core.ts, fail()); they do not reject. runCheck never looks at res.success, so a core failure yields ran: true, no issues, piiAbstained: false, and failures() stays empty. Reproduced by two reviewers with a fake altimate_core.check returning success:false: detectPii -> abstained:false, check().ran === true, no engine errors. A SQL the core cannot handle is therefore reported lint- and PII-clean and can still APPROVE and clear a block. The same pattern (res.data ?? {}) applies to grade/grain/source_filters/etc.
Fix: treat res.success === false like a throw: fail(method, res.error) and return the did-not-run result (ran: false), in every dispatcher-backed method.
There was a problem hiding this comment.
Thanks for reproducing it. Fixed in fix(review): address review comments: engine success:false, per-file isolation, failed-file verdict, base PII abstention, bot-review identity. Every altimate_core.* call goes through callCore, which turns success: false into a throw, so each method records fail(method, error) and returns its did-not-run result (check → ran: false → PII abstains). The new commit fix(review): address review feedback: PII abstention keeps the block, typed unverified kinds, safer dismissal, deepen --head`` also covers data.diff's in-band failure. Tests run a real `createDispatcherRunner` with a stubbed `success: false` Dispatcher.
| // An engine failure means some checks did not run: "no findings" is then | ||
| // unknown, not clean, so the verdict cannot be APPROVE. | ||
| const computed = computeIdealVerdict(input.findings, rubric) | ||
| const ideal = computed === "APPROVE" && input.engineErrors?.length ? "COMMENT" : computed |
There was a problem hiding this comment.
[MAJOR] File failures and PII abstentions do not prevent APPROVE
const ideal = computed === "APPROVE" && input.engineErrors?.length ? "COMMENT" : computedOnly engineErrors downgrades APPROVE. A per-file failure (review failed for this file: ...) and a PII abstention are recorded only in scope.unverified, which the verdict ignores. Reproduced: a one-model PR whose getContent throws EACCES gives verdict=APPROVE, idealVerdict=APPROVE; a runner returning detectPii -> {columns:[], abstained:true} also APPROVEs. The comment says "Approved" while a note says a file was never reviewed, which contradicts the PR's "failures are never clean" claim.
Fix: pass a typed completeness flag (or failed-file/abstained count) into buildEnvelope and apply the same APPROVE -> COMMENT downgrade. Add a verdict assertion to the unreadable-content test.
There was a problem hiding this comment.
Thanks. File failures were fixed in the earlier commit. The new commit adds a typed kind to scope.unverified (failed/abstained/not_compiled), and reviewIncomplete downgrades APPROVE → COMMENT for engine errors, failed files and abstentions. The unreadable-content test and the PII-abstention test now assert idealVerdict: COMMENT.
| /** True when no engine call and no file failed, so missing findings mean "fixed", not "not checked". */ | ||
| export function runCompleted(env: VerdictEnvelope): boolean { | ||
| if (env.engineErrors?.length) return false | ||
| return !(env.scope?.unverified ?? []).some((u) => u.reason.startsWith("review failed for this file")) |
There was a problem hiding this comment.
[MAJOR] runCompleted treats PII abstention as a completed run, so an earlier block is dismissed
return !(env.scope?.unverified ?? []).some((u) => u.reason.startsWith("review failed for this file"))Only the file-failure prefix counts as incomplete. Scenario: run 1 blocks on pii_exposure; the next push makes core's PII parser report parse_error, so piiAbstained is set and the finding disappears; runCompleted is true, the event is COMMENT, and dismissReview clears the block though nothing shows the PII was fixed (reproduced with a fake client: dismissReview was called).
Fix: treat abstentions as incomplete here too, preferably via a typed kind on unverified entries rather than matching reason text.
There was a problem hiding this comment.
Thanks, agreed. Fixed in the new commit: runCompleted is !reviewIncomplete(env), which uses the typed kind rather than matching reason text, so an abstention never dismisses. There's a test of a block surviving an abstained rerun.
| priorBotReview = reviews.some((r) => BOT_REVIEW_RE.test(r.body ?? "")) | ||
| const botReviews = reviews.filter((r) => BOT_REVIEW_RE.test(r.body ?? "")) | ||
| priorBotReview = botReviews.length > 0 | ||
| staleBlocking = botReviews.filter((r) => r.state === "CHANGES_REQUESTED").map((r) => r.id) |
There was a problem hiding this comment.
[MINOR] Dismissal is selected by body text only, and not tied to the run's commit
staleBlocking = botReviews.filter((r) => r.state === "CHANGES_REQUESTED").map((r) => r.id)botReviews is matched by BOT_REVIEW_RE on the body alone. A human CHANGES_REQUESTED review that quotes the headline (e.g. "Bot said: Changes requested ... (full tier") is selected and dismissed if the token has permission. Also, a slow run on an older push that finishes non-blocking can dismiss the block posted by a newer push's run, and in a monorepo with several project_dir jobs one project's clean run dismisses another's block.
Fix: also require the bot identity (user.type === "Bot" or the token's login), dismiss only when this run's head SHA equals the PR's current head, and scope by a per-project marker.
There was a problem hiding this comment.
Thanks. The human-quote case was fixed in the earlier commit (hidden marker or Bot author). The new commit adds two checks. Dismissal needs this run's scope.headSha (new, signed) to equal the PR's current head. Reviews below the repo root carry <!-- altimate-code-review:verdict project=<dir> -->, and only the same project's reviews are dismissed or counted. Tests cover an older push and another project's block.
| for (const depth of [50, 200, 1000]) { | ||
| try { | ||
| if ((await git(["rev-parse", "--is-shallow-repository"], cwd)).trim() !== "true") return false | ||
| const headSha = (await git(["rev-parse", "HEAD"], cwd)).trim() |
There was a problem hiding this comment.
[MINOR] Deepening fetches HEAD, not the configured head ref
const headSha = (await git(["rev-parse", "HEAD"], cwd)).trim()find() merge-bases against opts.head, but deepening resolves HEAD. With --head <ref> different from the checkout, deepening never helps and the review errors after three wasted fetches. Related: the first fetch (without --depth) in a shallow repo pulls the target branch's whole history, defeating the shallow checkout.
Fix: pass the head ref into fetchTargetHistory, and start with --depth=50 when the repo is shallow.
There was a problem hiding this comment.
Thanks. Fixed in the new commit: fetchTargetHistory deepens the configured head ref, and a shallow checkout starts with --depth=50 instead of the target's whole history. There's a test with --head different from the checkout and more than 50 commits on each side.
| // the new verdict. (Requires `pull-requests: write`; a failure is non-fatal.) | ||
| // Only a run that actually completed may clear a block: when an engine call | ||
| // or a file failed, the blocking finding may simply not have been produced. | ||
| if (event === "COMMENT" && staleBlocking.length && runCompleted(env)) { |
There was a problem hiding this comment.
[MINOR] Blocks are dismissed before the replacement review is posted
if (event === "COMMENT" && staleBlocking.length && runCompleted(env)) {If the later createReview fails (5xx, rate limit), the block is already gone and only the summary comment remains.
Fix: dismiss after createReview succeeds, or after the skip decision.
There was a problem hiding this comment.
Agreed, thanks. Fixed in the new commit: dismissal runs only after createReview succeeds (or on the skip path, where the summary is already updated). If both createReview attempts fail, the block stays (tested).
…le isolation, PII abstention, gate dismissal - The dispatcher runner records every engine call that throws (method, first reason, count) instead of silently returning empty. They are signed into the envelope (`engineErrors`), named in the comment, counted in `review_run.engine_errors`, and an empty review with engine errors is COMMENT, never APPROVE. - A failure while preparing one file, or a lane throwing for one file, marks that file unverified with the reason; the rest of the PR is still reviewed. PR-level lanes and the core-ran check are guarded the same way. - `detectPii` reports `abstained` when core could not analyse the SQL (check did not run, or its PII parser reported a parse error); the model is listed as not fully verified instead of passing as PII-clean. - When a rerun no longer blocks, earlier blocking altimate reviews are dismissed so the gate does not stay closed. The GitHub client is injectable so dedup, dismissal and skip rules are tested without the network. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fetch the base; upgrade note for gate users - a stale `CHANGES_REQUESTED` review is dismissed only when the new run completed (no `engineErrors`, no file that failed); an engine crash no longer unblocks a PR by making its findings disappear - in CI, a missing target branch is fetched from `origin` and a shallow history deepened (50/200/1000) until the merge-base exists, so the default `actions/checkout` works without `fetch-depth: 0`; still an error when that fails - docs: what changes for existing `gate` setups (pattern rules no longer block unless listed in `rubric.blockingRules`) and the new checkout behavior Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e isolation, failed-file verdict, base PII abstention, bot-review identity
- `runner.ts`: `altimate_core.*` handlers return `{ success: false }` instead of
throwing; a `callCore` wrapper rethrows so each method records the failure in
`engineErrors` and a failed check no longer reads as clean and PII-free
- `orchestrate.ts`: the synchronous `lineageBreakageLane` / `detectModelPatterns`
calls run as per-file tasks, and each schema.yml file is guarded, so one throw
degrades only that file instead of aborting the review
- `orchestrate.ts`: an unanalysable base no longer reports every head PII column
as newly exposed; the file is marked unverified instead
- `verdict.ts`: a file whose review failed downgrades an otherwise clean
verdict to COMMENT (shared `FAILED_FILE_REASON`)
- `post-github.ts`: stale blocking reviews must carry a hidden marker or a bot
author, so a human review quoting the headline is never dismissed
- `format.ts`: group unverified paths without re-spreading the array per item
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… typed unverified kinds, safer dismissal, deepen `--head` - `scope.unverified` entries carry a typed `kind` (`failed`, `abstained`, `not_compiled`). `reviewIncomplete` (engine errors, failed files, abstained checks) drives both the APPROVE -> COMMENT downgrade and `runCompleted`, so a PII abstention neither approves nor dismisses an earlier block. - Dismissal: only when this run's head (`scope.headSha`, new) is the PR's current head; only reviews carrying this project's marker (`<!-- altimate-code-review:verdict project=<dir> -->` below the repo root); and only after the replacement review was posted (or skipped). A failed `createReview` keeps the block. - `fetchTargetHistory` deepens the configured head ref, not `HEAD`, and a shallow checkout starts with `--depth=50` instead of the target's whole history. - Runner: `dataDiff` records an in-band `success: false`; the config-diff failure is named `dbtConfigDiff`; stale `/* skip */` comments removed. - One `errorReason` helper (one line, bounded) for runner failures, lane errors and failed files, so a multi-line message cannot break the note. - Docs: abstentions block APPROVE and keep the block; dismissal rules. - Tests: verdict on unreadable content and PII abstention, a block surviving abstention, older-push and other-project runs not dismissing, no dismissal when the replacement review fails, deepening past 50 commits with `--head`, `dataDiff` in-band failure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4004ec6 to
b354b9f
Compare
6736c7c to
27a9a99
Compare
| // not have been produced. A run on an older push (its head is no longer the | ||
| // PR's head) never clears the block a newer push's run may have posted. | ||
| const headSha = env.scope?.headSha | ||
| const onCurrentHead = !headSha || !commitId || headSha === commitId |
There was a problem hiding this comment.
WARNING: This guard never matches under the documented CI setup, so the gate is never dismissed.
scope.headSha is filled by run.ts from git rev-parse HEAD. With the documented workflow (actions/checkout on a pull_request event and no --head), HEAD is GitHub's PR merge commit (refs/pull/N/merge), while commitId here comes from pulls.get().head.sha — the branch head. The SHAs differ on every run, onCurrentHead is always false, and dismissStale returns early, so the "gate clears itself" behaviour this PR adds never fires for the setup the docs describe.
Consider also accepting the merge ref (e.g. compare commitId against the merge commit's parents, or use the event payload's pull_request.head.sha), or have run.ts record the PR head SHA. Separately, !commitId currently reads as "on the current head": if pulls.get fails, an older push's run can still clear a newer block. That fallback should fail closed.
|
@hkaltai, re your review: Thanks for the careful review. Two commits on top address all three MAJORs and the MINORs:
|
Changes since review: Review feedback commit: a PII abstention keeps the block, unverified kinds are typed, stale-review dismissal is safer, and
--headruns deepen history when needed.Issue for this PR
Closes #1792
Stacked on #1722 (← #1721 ← #1720 ← #1719); merge in that order.
Type of change
What does this PR do?
A broken review could look like a clean one:
ReviewRunnermethod caught its errors and returned empty. A failed native core read as "no findings" and could produce APPROVE.Promise.allhad no error handling, so one file throwing rejected the whole review.Fixes:
engineErrors, named in the comment, and counted inreview_run.engine_errors. An empty review with engine errors is COMMENT, never APPROVE.detectPiireturnsabstainedwhen core couldn't analyse the SQL (check didn't run, orpii.parse_error). The model is listed as not fully verified.CHANGES_REQUESTEDreviews are dismissed with a pointer to the new verdict.postGitHubReviewtakes an optional client, so dedup, dismissal and skip are tested without the network.Not in this PR: wiring the break-glass override (
applyOverride) behind maintainer authorization. That needs a decision on who may override and where the audit record lives.Follow-up after an adversarial review (commit
2f865225ec):CHANGES_REQUESTEDreview is dismissed only when the new run completed (noengineErrors, no file that failed). Before, an engine crash on the next push made the findings disappear, and the block was dismissed.origin, and a shallow history is deepened (50, 200, 1000) until the merge-base exists. The defaultactions/checkouttherefore works withoutfetch-depth: 0. It's still an error when that fails.gateusers in the docs. Pattern-rule findings now comment instead of blocking, unless they're listed inrubric.blockingRules.git clone --depth 1with onlyGITHUB_BASE_REFset.How did you verify your code works?
test/altimate/review-failures-gate.test.ts(9 tests):engineErrorssigned and tamper-evident; an empty clean run still approvesbun typecheckis clean.Cost side effects
None. At most one
dismissReviewcall per stale blocking review on a non-blocking rerun.Screenshots / recordings
N/A (CLI).
Checklist
🤖 Generated with Claude Code
Summary by cubic
Fixes the review so engine failures, per-file crashes, and PII parse errors can no longer read as a clean pass, a stale blocking review is cleared only by a completed non-blocking rerun, and a shallow CI checkout can fetch the base it needs.
Bug Fixes
engineErrors, shown in the comment, and counted in telemetry, and an empty review with engine errors is COMMENT, never APPROVE.detectPiireportsabstainedwhen core couldn't analyse the SQL (check didn't run or its PII parser errored), listing the model as not fully verified instead of PII-clean.pull-requests: write); the GitHub client is injectable so dedup, dismissal, and skip rules are tested without the network.originand history deepened until the merge-base exists, so the default shallowactions/checkoutworks withoutfetch-depth: 0; if that fails, the review errors instead of diffing another branch.gatesetups unless listed inrubric.blockingRules.Written for commit 27a9a99. Summary will update on new commits.